﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

using System.Windows.Media.Imaging;

namespace LEEAAttendanceControl.Views
{
    public partial class MessageDisplay : ChildWindow
    {
        public MessageDisplay()
        {
            InitializeComponent();
        }

        public MessageDisplay(string message, string title, string type)
        {
            InitializeComponent();

            MessageBlock.Text = message;

            Title = title;

            string uri = String.Empty;

            switch (type)
            {
                case "Save":
                    uri = "/LEEAAttendanceControl;component/Images/Save.png";

                    MessageImage.Source = new BitmapImage(new Uri(uri, UriKind.Relative));

                    OKButton.Margin = new Thickness(0);

                    Width = 180;
                    CancelButton.Width = 0;

                    break;

                case "Error":
                    uri = "/LEEAAttendanceControl;component/Images/Error.png";

                    MessageImage.Source = new BitmapImage(new Uri(uri, UriKind.Relative));

                    OKButton.Margin = new Thickness(0);

                    CancelButton.Width = 0;

                    break;

                case "Ask":
                    uri = "/LEEAAttendanceControl;component/Images/Ask.png";

                    MessageImage.Source = new BitmapImage(new Uri(uri, UriKind.Relative));

                    break;
            }
        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }
    }
}

